#include <iostream>
#include <jsoncpp/json/json.h>
#include <memory>
#include <sstream>
using namespace std;

int main()
{
  Json::Value root;
  const char* name = "json";
  int age = 18;
  float score[3] = {90.1, 88, 95.2};
  root["name"] = name;
  root["age"] = age;
  root["score"].append(score[0]);
  root["score"].append(score[1]);
  root["score"].append(score[2]);
  Json::StreamWriterBuilder swb;
  unique_ptr<Json::StreamWriter> sw_ptr(swb.newStreamWriter());
  stringstream ss;
  sw_ptr->write(root, &ss);
  cout << ss.str() << endl;
  return 0;
}
